<%--
  Created by IntelliJ IDEA.
  User: qiliping
  Date: 16/4/9
  Time: 下午5:03
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <title>业务员详情</title>
    <script>
        $(function(){
            $(".auditpass").bind("click",function () {
                var status = $(this).attr("status");
                var agentId = $("#agent").val();
                if (agentId == null||agentId=="") {
                    alert("请选择分配到哪家公司");
                    return;
                }
                if (confirm("确定要审核通过吗?")) {
                    $.ajax({
                        url: "${ctx}/team/sale_man_audit",
                        type: "post",
                        dataType: "json",
                        data: {saleManId:${saleMan.agentId}, status: status, agentId: agentId},
                        success: function (res) {
                            if (res == 1) {
                                $("#auditCon").html("");
                            }else{
                                alert("系统错误,请重新再试!");
                            }
                        }
                    });
                }
            });
        })

    </script>
</head>
<body>
<div class="row">
    <div class="col-md-12">
        <!-- BEGIN PAGE TITLE & BREADCRUMB-->
        <h3 class="page-title">
            业务团队管理
            <small>公司业务员管理</small>
        </h3>
        <ul class="page-breadcrumb breadcrumb">
            <li>
                <i class="fa fa-home"></i>
                <a href="${ctx}/main">
                    首页
                </a>
                <i class="fa fa-angle-right"></i>
            </li>
            <li>
                <a href="${ctx}/team/sale_man_list">
                    业务团队管理
                </a>
                <i class="fa fa-angle-right"></i>
            </li>
            <li>
                <a href="#">
                    业务员详情
                </a>
            </li>
        </ul>
        <!-- END PAGE TITLE & BREADCRUMB-->
    </div>
</div>

<div class="main">


    <div class="row">
        <div class="col-md-12">

            <div class="tabbable-custom ">
                <ul class="nav nav-tabs ">
                    <li class="active"><a href="javascript:void(0)">业务员详情</a></li>
                </ul>
                <div class="tab-content">
                    <div id="accounts" class="tab-pane active">
                        <div class="">
                            <div class="row">

                                <div class="col-md-3">
                                    <div class="form-group">
                                        <label>姓名：</label><span>${saleMan.agentName}</span>
                                    </div>
                                </div>
                                <div class="col-md-12">
                                    <h3 class="form-group">
                                        <label>联系电话：</label><span
                                            class="color_f34915">${saleMan.linkPhone}</span>
                                    </h3>
                                </div>
                                <div class="col-md-3">
                                    <div class="form-group">
                                        <label>个人简介：</label><span>${saleMan.intro}</span>
                                    </div>
                                </div>
                                <div class="col-md-3">
                                    <div class="form-group">
                                        <label>申请时间：</label><span><fmt:formatDate value="${saleMan.applyTime}"
                                                                                  pattern="yyyy-MM-dd HH:mm"></fmt:formatDate> </span>
                                    </div>
                                </div>
                                <div class="col-md-3">
                                    <div class="form-group">
                                        <label>状态：</label><span>
                                        <c:choose>
                                            <c:when test="${saleMan.status==0}">
                                                申请中
                                            </c:when>
                                            <c:when test="${saleMan.status==1}">
                                                已通过
                                            </c:when>
                                            <c:when test="${saleMan.status==2}">
                                                已拒绝
                                            </c:when>
                                            <c:when test="${saleMan.status==3}">
                                                已取消
                                            </c:when>
                                        </c:choose>
                                    </span>
                                    </div>
                                </div>

                            </div>
                            <c:if test="${saleMan.status==0}">
                                <div class="row" id="auditCon">
                                    <div class="col-md-12">
                                        <div class="panel panel-default">
                                            <div class="panel-heading">
                                                <h3 class="panel-title text-center">业务员审核</h3>
                                            </div>
                                            <div class="panel-body">
                                                <div class="col-md-6">
                                                    <div class="form-group">
                                                        <label>选择公司：</label>

                                                        <div class="date-control small">
                                                            <div class="input-daterange input-group">
                                                                <select name="agent" id="agent">
                                                                    <option value="">--请选择--</option>
                                                                    <c:forEach var="item" items="${agentList}">
                                                                        <option value="${item.agentId}">${item.agentName}</option>
                                                                    </c:forEach>
                                                                </select>

                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>

                                                <div class="col-md-6">
                                                    <div class="form-group">
                                                        <label></label>

                                                        <div class="date-control small">
                                                            <div class="input-daterange input-group">


                                                            </div>
                                                        </div>
                                                        <input type="button" id="auditpass" class="btn blue auditpass"
                                                               status="1" value="审核通过"/>
                                                        <input type="button" id="auditnotpass" class="btn blue auditpass"
                                                               status="0" value="审核不通过"/>
                                                    </div>
                                                </div>

                                            </div>
                                        </div>
                                    </div>

                                </div>
                            </c:if>

                        </div>
                    </div>
                </div>
            </div>


        </div>
    </div>

</div>

</body>
</html>
